package com.fjwt.gz.service.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjwt.gz.core.third.bo.CouponAwardBo;
import com.fjwt.gz.db.dto.ActivityAwardDTO;
import com.fjwt.gz.db.dto.AwardCouponDTO;
import com.fjwt.gz.db.entity.AwardCouponEntity;
import com.fjwt.gz.db.vo.AwardCouponVO;
import com.fjwt.gz.db.vo.ExportAwardVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 卡券活动信息表 Mapper 接口
 * </p>
 *
 * @author shiyonghao
 * @since 2025-04-09
 */
public interface AwardCouponMapper extends BaseMapper<AwardCouponEntity> {

    /**
     * 查询已结束卡券的支付通道
     * @param page
     * @return
     */
    IPage<CouponAwardBo> selectOverAwardPayAuth(Page page);

    IPage<AwardCouponVO> queryList(IPage iPage, @Param("awardCouponDTO") AwardCouponDTO awardCouponDTO);

    List<AwardCouponVO> queryList(@Param("awardCouponDTO") AwardCouponDTO awardCouponDTO);

    //查询商家券专用（sql命名不对勿动）
    List<AwardCouponDTO> selectProcessCopy(@Param("activityId") Long activityId,@Param("date") String date);

    /**
     * 查询出资方配置活动信息
     * @return
     */
    List<String> queryPayConfigList();

    /**
     * 根据活动ID查询卡券活动信息表
     * @return
     */
    List<AwardCouponDTO> selectjh(@Param("activityId") Long activityId);

    List<AwardCouponDTO> selectProcess(@Param("activityId") Long activityId,@Param("date") String date);

    int selectCount(@Param("activityId") Long activityId,@Param("awardId") Long awardId,@Param("createdAt") String createdAt);

    /**
     * 根据奖品ID查询卡券支付通道
     * @return
     */
    String selectIfCode(@Param("couponId") Long couponId);

    List<AwardCouponDTO> selectProcessMchInFo(Long fansId, String agentNo, Integer state);

    IPage<AwardCouponDTO> mchCouponInfo(IPage iPage, @Param("agentNo")String agentNo, @Param("state")Integer state,@Param("states")Integer states,@Param("auditFlowId")Integer auditFlowId,@Param("agentlave")Integer agentlave);

    IPage<AwardCouponDTO> mchCouponInfos(IPage iPage, @Param("agentNo")String agentNo, @Param("state")Integer state,@Param("states")Integer states,@Param("auditFlowId")Integer auditFlowId,@Param("agentlave")Integer agentlave);

    IPage<ExportAwardVO> activityCouponDetail(IPage page, @Param("activityAwardDTO") ActivityAwardDTO activityAwardDTO);
    List<ExportAwardVO> activityCouponDetail(@Param("activityAwardDTO") ActivityAwardDTO activityAwardDTO);
//    ExportAwardVO activityCouponNum(@Param("activityAwardDTO") ActivityAwardDTO activityAwardDTO);

}
